/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package interest;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author rguembes
 */
@Entity
@Table(name = "POIREVIEW")
@NamedQueries({
    @NamedQuery(name = "Poireview.findAll", query = "SELECT p FROM Poireview p"),
    @NamedQuery(name = "Poireview.findById", query = "SELECT p FROM Poireview p WHERE p.id = :id"),
    @NamedQuery(name = "Poireview.findByPoiId", query = "SELECT p FROM Poireview p WHERE p.poiId = :poiId"),
    @NamedQuery(name = "Poireview.findByAuthor", query = "SELECT p FROM Poireview p WHERE p.author = :author"),
    @NamedQuery(name = "Poireview.findByReview", query = "SELECT p FROM Poireview p WHERE p.review = :review"),
    @NamedQuery(name = "Poireview.findByDate", query = "SELECT p FROM Poireview p WHERE p.date = :date")})
public class Poireview implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Column(name = "POI_ID")
    private Integer poiId;
    @Column(name = "AUTHOR")
    private String author;
    @Column(name = "REVIEW")
    private String review;
    @Column(name = "DATE")
    @Temporal(TemporalType.DATE)
    private Date date;

    public Poireview() {
    }

    public Poireview(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getPoiId() {
        return poiId;
    }

    public void setPoiId(Integer poiId) {
        this.poiId = poiId;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getReview() {
        return review;
    }

    public void setReview(String review) {
        this.review = review;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Poireview)) {
            return false;
        }
        Poireview other = (Poireview) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "interest.Poireview[id=" + id + "]";
    }

}
